home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / devel201.zip / SPELL.H < prev    next >
C/C++ Source or Header  |  1995-02-19  |  5KB  |  143 lines

  1. /**************************************************************************************************
  2.  
  3.     SPELLCHK
  4.     Spelling checker.
  5.  
  6.     Written and copyright by Brian J Quinion 1994.
  7.  
  8.     Version for Microsoft Windows.
  9.     Version:  0.01 (Production)
  10.     Date:     26 May 1994
  11.     Module:   SPELL.H
  12.  
  13. **************************************************************************************************/
  14.  
  15. #if !defined(__DIR_H)
  16. #include <dir.h>
  17. #endif
  18.  
  19. #if !defined(__WINDOWS_H)
  20. #include <windows.h>
  21. #endif
  22.  
  23. #define MAXSPELL                        255
  24. typedef WORD HUNDO;
  25.  
  26. /************************************************************************************************
  27.  
  28.     There are two ways to access the DLLs.  This first method is the full interface  It is 
  29.     quite complicated but allows full control of the DLL.  Its design is based on that used
  30.     for the common dialog boxes.  The functions mentioned are contained in the spellchk DLL. 
  31.  
  32.     See Help file
  33.  
  34. ************************************************************************************************/
  35.  
  36. // Custom dictionaries
  37.  
  38.     // Defines
  39.     #define MAXDICTITLE             20
  40.  
  41.     #define CD_READONLY             1
  42.     #define CD_DISABLED             2
  43.     #define CD_CHANGED              4
  44.  
  45.     // Structure
  46.     typedef struct
  47.     {
  48.         char                        DicFile[MAXPATH];
  49.         char                        DicTitle[MAXDICTITLE];
  50.         BYTE                        Options;
  51.     // Reserved
  52.         BYTE                         Reserved[8];
  53.     } CUSTDIC, far * LPCUSTDIC;
  54.  
  55.  
  56. // Main options block 
  57.  
  58.     // Defines - Setting for the CheckWordOptions flag
  59.     #define CWO_ALLOWCHANGE                 1
  60.     #define CWO_AUTOSUGGEST                 2
  61.     #define CWO_SUGGESTCUST                 4
  62.     #define CWO_NOOPTIONS                   8
  63.     #define CWO_UNDO                        16
  64.     #define CWO_NOHELP                      32
  65.  
  66.     #define CWO_USEMAINHOOK                 64
  67.     #define CWO_USEOPTIONSHOOK              128
  68.     #define CWO_USECUSTOMMAINDLG            256
  69.     #define CWO_USECUSTOMOPTIONSDLG         512
  70.     #define CWO_SENDMSGTOMAINHOOK           1024
  71.     #define CWO_SENDMSGTOOPTIONSHOOK        2048
  72.  
  73.     #define CWO_CHECKMULTIPLE               4096
  74.  
  75.     #define CWO_DONTUSEFULL                 8192
  76.  
  77.     // Structure
  78.  
  79.     typedef struct
  80.     {
  81.         WORD                wSizeOfBlock;
  82.  
  83.         HWND                hWndParent,
  84.                 hWndDlg;
  85.  
  86.         WORD                CheckWordOptions;
  87.         char                szLanguage[13];
  88.         HGLOBAL             hCustomDics;
  89.         BYTE                NumCustom;
  90.         BYTE                CurCustom;
  91.  
  92.         HINSTANCE           hInstance;
  93.         DLGPROC             fpMainHook;
  94.         DLGPROC             fpOptionsHook;
  95.         LPSTR               lpMainDlg;
  96.         LPSTR               lpOptionsDlg;
  97.  
  98.         DWORD               dwCustData;
  99.         DWORD               dwCustData2;
  100.  
  101.         char                ToCheck[MAXSPELL];
  102.         char                Changed[MAXSPELL];
  103.         BOOL                bCurWordChanged;
  104.  
  105. // Private data space for the program
  106.         BYTE                Reserved[26+MAXSPELL];
  107.     } CHECKWORD, FAR * LPCHECKWORD;
  108.  
  109.     // Functions
  110.     BOOL WINAPI SPCHK_CheckWord(LPCHECKWORD);
  111.     void WINAPI SPCHK_Options(LPCHECKWORD);
  112.  
  113.     // Notification messages/requests
  114.     #define SPELL_GETNEXT                      (WM_USER+240)
  115.     #define SPELL_WORDNOTFOUND                 (WM_USER+241)
  116.     #define SPELL_WORDCHANGED                  (WM_USER+242)
  117.     #define SPELL_CANUNDO                      (WM_USER+243)
  118.     #define SPELL_STOREUNDO                    (WM_USER+244)
  119.         #define UNDO_FAIL           0
  120.         #define UNDO_IGNORE         1
  121.         #define UNDO_IGNOREALL      2
  122.         #define UNDO_CHANGE         3
  123.         // > 3 means an ADD
  124.     #define SPELL_UNDOLAST                     (WM_USER+245)
  125.     #define SPELL_GETCUSTOMDEFPATH             (WM_USER+246)
  126.         #define SPELL_HELPMAIN                     (WM_USER+247)
  127.         #define SPELL_HELPOPTIONS                  (WM_USER+248)
  128.         #define SPELL_HELPEDITDIC                  (WM_USER+249)
  129.  
  130. /************************************************************************************************
  131.  
  132.     This second method is far simpler, and simply allow your program to call the existing code
  133.     as if the keyboard hot key had been pressed (in fact exactly the same routines are used).
  134.     The functions mentioned are contained in the spelledt DLL. 
  135.  
  136.     See Help file
  137.  
  138. ************************************************************************************************/
  139.  
  140. // Functions
  141.      BOOL CALLBACK SPEDT_CheckEdit(HWND);
  142.      void CALLBACK SPEDT_SetupBox(HWND);
  143.